/*
** my_strncmp.c for my_strncmp in /home/gueux_g/piscine/Jour_06
**
** Made by gregory gueux
** Login   <gueux_g@epitech.net>
**
** Started on  Tue Oct  9 00:58:40 2012 gregory gueux
** Last update Wed Oct 24 15:52:16 2012 gregory gueux
*/

int	my_strncmp(char *s1, char *s2, int n)
{
  int	i;
  int	resul;

  i = 0;
  while (s1[i] && s2[i] && i <= n)
    {
      resul = s1[i] - s2[i];
      if (resul != 0)
	return (resul);
      i = i + 1;
    }
  if (s1[i] == '\0' && s2[i] == '\0')
    return (0);
  else if ( s1[i] == '\0')
    return (1);
  else
    return (-1);
}
